<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>remove detach</title>
	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js"></script>
</head>
<body>
	<div>
		<p class="pa">a</p>
		<p>b</p>
		<p id="pc">删除a</p>
		<p id='back'>恢复a</p>
	</div>
	<script>
		$('.pa').click(function(){
			$(this).append('111');
		});
		var pa = '';
		$('#pc').click(function(){
			 //删除.pa的p标签并返回删除内容给pa变量
			 pa = $('div p').remove('.pa');
			 // pa = $('p').detach('.pa');
		});
		
		
		//$(pa[0]).prependTo('div');
		$('#back').click(function(){
			$('p:first').before(pa[0]);
		});
		
		console.log(pa);


	</script>
</body>
</html>